From fcc8a365b9ea0d7c3c01dad338295acfce68a602 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 28 May 2019 23:43:05 -0400 Subject: [PATCH] main: Use gdk_surface_translate_coordinates This gets rid of another use of global coordinates. --- gtk/gtkmain.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 71b1dce79b..c57c09e70e 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1216,14 +1216,11 @@ rewrite_events_translate (GdkSurface *old_surface, gdouble *x, gdouble *y) { - gint old_origin_x, old_origin_y; - gint new_origin_x, new_origin_y; - - gdk_surface_get_origin (old_surface, &old_origin_x, &old_origin_y); - gdk_surface_get_origin (new_surface, &new_origin_x, &new_origin_y); - - *x += old_origin_x - new_origin_x; - *y += old_origin_y - new_origin_y; + if (!gdk_surface_translate_coordinates (old_surface, new_surface, x, y)) + { + *x = 0; + *y = 0; + } } static GdkEvent * -- 2.30.2